/*
 *--------------------------------------------------------------------------
 *   File Name:	irq.h
 * 
 * Description:	none
 * 
 * 
 *      Author:	Zhao Yanbai [zhaoyanbai@126.com]
 * 
 *     Version:	1.0
 * Create Date: Fri Nov 28 16:38:25 2008
 * Last Update: Fri Nov 28 16:38:25 2008
 * 
 *--------------------------------------------------------------------------
 */

#ifndef	_IRQ_H
#define	_IRQ_H

#include"system.h"

#define	NR_IRQS		224
#define	FIRST_IRQ_VECT	0x20

typedef	struct
{
	const char *name;
	int 	(*enable)(unsigned int irq);
	int 	(*disable)(unsigned int irq);
	void	(*ack)(unsigned int irq);
} IRQChip, *pIRQChip;

typedef struct irqaction
{
	void (*handler)(pPTRegs regs, unsigned int irq);
	const char *dev_name;
	void *dev_id;
	struct irqaction *next;	
} IRQAction, *pIRQAction;

typedef	struct
{
	pIRQChip	chip;
	pIRQAction	action;
	unsigned int	status;
	unsigned int	depth;
} IRQDesc, *pIRQDesc;

extern	IRQChip	i8259A_chip;
extern	IRQDesc	irq_desc[];
extern	IRQDesc	no_irq_desc;

#endif //_IRQ_H
